var xtDataDictionaryWinAdd;
var xtDataDictionaryFormAdd;
function addXtDataDictionary(xt_data_dictionary_id){
	initXtDataDictionaryFormAdd();
	if(null != xt_data_dictionary_id && '' != xt_data_dictionary_id){
		Ext.getCmp('xt_data_dictionary_pid').setValue(xt_data_dictionary_id);
	}
	xtDataDictionaryWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtDataDictionaryFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtDataDictionaryFormAdd,'../xtDataDictionaryController/addXtDataDictionary',grid,xtDataDictionaryWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtDataDictionaryWinAdd.show();
}
function initXtDataDictionaryFormAdd(){
	xtDataDictionaryFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		labelWidth:50,
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'4 5 4 5'
		},
		items:[
		{
			fieldLabel:'字典名称',
			xtype:'textfield',
			name:'xt_data_dictionary_name',
			maxLength:50,
			anchor:'40%'
		},
		{
			fieldLabel:'上&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级',
			xtype:'textfield',
			name:'xt_data_dictionary_pid',
			id:'xt_data_dictionary_pid',
			maxLength:32,
			hidden:true,
			anchor:'40%'
		},
		{
			fieldLabel:'键&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;值',
			xtype:'textfield',
			name:'xt_data_dictionary_value',
			maxLength:50,
			anchor:'40%'
		},
		{
			fieldLabel:'态&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;状',
			xtype:"combo",
            store:[["0","启用"],["1","暂停"]],
            emptyText:"请选择",
            mode:"local",
            value:'0',
            triggerAction:"all",
            editable:false,
			name:'xt_data_dictionary_state',
			hiddenName:'xt_data_dictionary_state',
			anchor:'40%'
		},
		{
			fieldLabel:'排序编号',
			xtype:'numberfield',
			name:'xt_data_dictionary_soft',
			id:'xt_data_dictionary_soft',
			maxLength:32,
			anchor:'40%'
		},
		{
			fieldLabel:'注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;备',
			xtype:'textareafield',
			name:'xt_data_dictionary_remark',
			maxLength:200,
			anchor:'100%'
		}
		]
	});
}
